<template>
  <header>
    <div class="contentCenter clearfix">
      <div class="logo fl">LOGO</div>
      <div class="right fr">
        <span data-index="/post" @click="changeRoute($event)" :class="{'active':current==='/post'}">职位发布</span>
        <span data-index="/company" @click='changeRoute($event)' :class="{'active':current==='/company'}">企业信息</span>
      </div>
    </div>
  </header>
</template>
<script>
export default {
  name:'commonHead',
  data(){
    return {
      current:"/company"
    }
  },
  methods:{
    changeRoute(e){
      let index = e.target.getAttribute('data-index');
      this.current = index;
      this.$router.push({path:index});
    },
  }
}
</script>
<style scoped lang='less'>
@import './head.less';
</style>



